package com.hzc.springchan.strategy.restrequest;

import com.hzc.springchan.enums.CMethod;
import org.aspectj.lang.JoinPoint;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.Map;

/**
 * rest请求策略环境类
 * @author chen990627
 * @date 2022/10/18
 */
@Component
public class RestRequestContext {

    @Autowired
    private Map<String, IRestRequestStrategy> container;

    public void restRequest(JoinPoint point, CMethod cMethod) {
        container.get(cMethod.getRestRequestStrategy()).restRequest(point);
    }
}
